{% extends "filebrowser/serve.html" %}

{% load i18n %}
{% load breadcrumbs %}
{% load details %}

{% block breadcrumbs %}
    {% add_crumb 'Home' '/' %}
    {% add_crumb 'Files' 'file_serve' '' %}
    {% if fileinfo.path != '' %}
    {% include "filebrowser/parent.html" %}
    {% add_crumb fileinfo.name fileinfo.url %}
    {% endif %}
    {% add_crumb 'Delete' %}
{% endblock %}

{% block subtitle %}{% trans "Delete" %}{% endblock %}

{% block main %}
<div class="details">
    <form method="post" action="{% url file_delete fileinfo.url|slice:'1:' %}">
        {% csrf_token %}
        {% if fileinfo.is_link %}
        <p>{% trans "Are you sure you want to delete this link?" %}</p>
        {% else %}
        {% if fileinfo.is_folder %}
        <p>{% trans "Are you sure you want to delete this folder?" %}</p>
        {% else %}
        <p>{% trans "Are you sure you want to delete this file?" %}</p>
        {% endif %}
        {% endif %}
        {% include "elements/submit_button.html" %}
        {% with fileinfo.parent.url as next %}{% include "elements/cancel_button.html" %}{% endwith %}
    </form>
</div>
{% endblock %}
